<?php

namespace Database\Factories;

use App\Models\ESCluster;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Model>
 */
class ESClusterChargeLogFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'begin_at' => $this->faker->dateTimeBetween($startDate = '-2 months', '-1 months')->format('Y-m-d'),
            'end_at' => $this->faker->dateTimeBetween($startDate = '-1 months', $endDate = 'now')->format('Y-m-d'),
            'power' => $this->faker->randomElement(['86.32', '74.53', '77.94']),
            'state' => $this->faker->randomElement(['charge', 'discharge']),  
            'remarks' => '',
            'e_s_cluster_id' =>  $this->faker->randomElement(ESCluster::all()->pluck('id')),
        ];
    }
}
